<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link rel="stylesheet" href="css/common.css" type="text/css" />
        <link href="css/adminstyle.css" rel="stylesheet" type="text/css">
        
<link href="js/uploadify/uploadify.css" rel="stylesheet" type="text/css">
<script language="javascript" type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script language="javascript" type="text/javascript" src="js/uploadify/swfobject.js"></script>
<script language="javascript" type="text/javascript" src="js/uploadify/jquery.uploadify.v2.1.4.min.js"></script>        
        <title>            管理区域        </title>
    </head>
    
    <body>
        <div id="man_zone">
          <form method="post" action="<? if  (empty($id)){ echo  'nav_subAdd.html'; }else{ echo  'nav_subUpdate.html'; }  ?>">
                <input name="id" type="hidden" value="<?=$id?>">
              <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1"
                class="tableborder">
                  <tr bgcolor="#ffffff">
                      <td class="left_title_2adminssd">             标题                   </td>
                      <td>
                          <input name="title" type="text" value="<?=isset($title)?$title:''?>">
                      </td>
                        <td>图标</td>
                        <td>
                         <?php $display_style='none'; $upload_value="";?>
	      <?if(getStr($extract_vars,'banner')!=""){?>
		  		<?  $display_style='inline-block';?>
		  		<?  $upload_value=htmlspecialchars(getStr($extract_vars,'banner'));?>
	      <?}?>
	      <input id="file_upload_banner" id2="41"  name="file_upload_banner" class="file_upload" type="file" multiple="true">
	      <br>
	      <a href="javaScript:void(0);" class="del_file" style="display:<?=$display_style?>">&nbsp;&nbsp;&nbsp;&nbsp;删除附件</a>
	      <a class="file_link" href="../<?=$upload_value?>" target="_blank" style="display:<?=$display_style?>"/>查看</a>
	      <input type="hidden" class="file_src" name="banner" value="<?=$upload_value?>" id="banner" >	
                        </td>
                  </tr>

<script type="text/javascript">
    $(document).ready(function() {
		$(function() {
			$('.file_upload').uploadify({
		        'uploader'  : 'js/uploadify/uploadify.swf',
		        'script'    : 'js/uploadify/uploadify.php',
		        'cancelImg' : 'js/uploadify/cancel.png',
		        'folder'    : 5,
		        'auto'      : true,
		        'fileExt'   : '*.gif;*.jpg;',
		        'fileDesc'  : 'Web Image Files (.GIF,*.JPG)',
		        'sizeLimit' : '2097152',
		        'onComplete'  : function(event, ID, fileObj, response, data) {
		          $("#" + $(event.target).attr("id")).nextAll(".del_file").show();
		          $("#" + $(event.target).attr("id")).nextAll(".file_src").val(response);
		          $("#" + $(event.target).attr("id")).nextAll(".file_link").attr("href","../"+response);
		          $("#" + $(event.target).attr("id")).nextAll(".file_link").show();
		        }		        
			});
		});
    });	
    
    $(".del_file").click(
        function()
        {
          if(confirm("您确认要删除该附件么？"))
          {
            $(this).hide();
            $(this).nextAll(".file_src").val("");
            $(this).nextAll(".file_link").attr("href","");
            $(this).nextAll(".file_link").hide();
            alert("附件已成功删除");
          }
        }
    )
</script>                   
                  <tr bgcolor="#ffffff">
                      <td class="left_title_2adminssd">  链接     </td>
                      <td>
                          <input name="url" type="text" value="<?=isset($url)?$url:''?>" />
                      </td>
                      <td>排序   </td>
                      <td>
                          <input name="sort" type="text" value="<?=isset($sort)?$sort:''?>" />
                      </td>
                  </tr>
                  <tr bgcolor="#ffffff">
                      <td class="left_title_2adminssd">  链接类型     </td>
                      <td colspan="3">
                      <select name="link_type">
                     	<?=$linkTypeOption?>
                     </select> 
                      </td>
                  </tr>
                  <tr bgcolor="#ffffff">
                      <td class="left_title_2adminssd">  父级             </td>
                      <td>
                          <select name="father_id" size="12" id="select">
                              <option value="0" <? if ($father_id==0){ echo "selected"; } ?>
                                    >根栏目
                              </option>
                              <? function classInfo ($data,$leve=0,$tmp,$father_id) { if (!empty($data))
                                { if ($leve>
                                    0) { $tmp="&nbsp;&nbsp;".$tmp; } $leve++; foreach ($data as $v) { ?>
                                  <option value="<?=$v['id']?>" <? if ($father_id==$v[ 'id']){ echo  "selected"; } ?>   >
                                      <? echo $tmp. "|-".$v[ 'title']; ?>
                                  </option>
                                  <? classInfo($v[ 'next'],$leve,$tmp,$father_id); } } } classInfo($functions,0,"",$father_id); ?>
                          </select>
                      </td>
                    <td>是否在导行显示</td>
                      <td><input name="status"  type="checkbox" id="checkbox" value="1"  <?$status = isset($status)?$status:'';  if (empty($status) || $status==1 ){echo 'checked="checked"';  }  ?> />
                      </td>
                  </tr>
                  <tr bgcolor="#ffffff">
                    <td class="left_title_2adminssd">详细内容展示类型</td>
                     <td colspan="3">
                     <select name="news_type">
                     <?=$newsTypeOption?>
                     </select>
                     </td>
                  </tr>
            	  <tr bgcolor="#ffffff">
                    <td class="left_title_2adminssd">详细内容展示</td>
                     <td colspan="3">
                     <input name="news_status"  type="checkbox" id="checkbox" value="1"   <?  $news_status = isset($news_status)?$news_status:'';  if ($news_status==NAV_NEWS_STATUS_CHECKED ){echo 'checked="checked"';  }  ?> />
                     </td>
                  </tr>
                  <tr bgcolor="#ffffff">
                      <td colspan="8" align="center" >
                          <input name="back" type="button" class="PublicBot" value="返回" onclick="window.history.go(-1);"     />
                          <input name="submit" type="submit"  class="PublicBot" value="提交" />
                      </td>
                  </tr>
              </table>
            </form>
        </div>
    </body>
</html>